/** * 项目管理 * */
<template>
  <div class="w-table">
    <van-nav-bar
      title="标题"
      left-text="返回"
      right-text="按钮"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />

    <table-search v-model="queryData.keyword" @change="request" />
  </div>
</template>
<script>
import $api from './api.js'

export default {

  // 组件
  components: {
  },

  // 过滤器
  filters: {},
  data() {
    return {
      list: [],
      queryData: {
        keyword: '',
        pageNo: 1,
        pageSize: 10,
      },
    }
  },

  // 生命周期
  created() {},
  beforeUnmount() {},
  mounted() {
    // this.load()
  },

  // 方法
  methods: {
    load() {
      this.request()
    },
    request() {
      const sendData = {
        ...this.queryData,
      }
      this.loading = true
      $api
        .list(sendData)
        .then((res) => {
          this.loading = false
          this.list = []
          this.list = res.data
          this.page.total = res.total
        })
        .catch((error) => {
          this.loading = false
          console.log('list catch', error.config)
        })
    },
    filterChange(d) {
      this.queryData = {
        ...this.queryData,
        ...d,
      }
      this.queryData.pageNo = 1
      this.request()
    },
    pageSizeChange(v) {
      this.queryData.pageSize = v
      this.request()
    },
    pageChange(v) {
      this.queryData.pageNo = v
      this.request()
    },
    onClickLeft() {},
    onClickRight() {},
  },
}
</script>

<style lang="less" scoped></style>
